package system

import (
	"gin-sns/app/ginframe/router"
	"gin-sns/app/service/middleware/auth"
)

//加载路由
func init() {
	// 分组路由注册方式
	g1 := router.New("admin", "/system/dept", auth.Auth)
	g1.GET("/", "system:dept:view", DeptController.List)
	g1.POST("/list", "system:dept:list", DeptController.ListAjax)
	g1.GET("/add", "system:dept:add", DeptController.Add)
	g1.POST("/add", "system:dept:add", DeptController.AddSave)
	g1.POST("/remove", "system:dept:remove", DeptController.Remove)
	g1.GET("/remove", "system:dept:remove", DeptController.Remove)
	g1.GET("/edit", "system:dept:edit", DeptController.Edit)
	g1.POST("/edit", "system:dept:edit", DeptController.EditSave)
	g1.POST("/checkDeptNameUnique", "system:dept:view", DeptController.CheckDeptNameUnique)
	g1.POST("/checkDeptNameUniqueAll", "system:dept:view", DeptController.CheckDeptNameUniqueAll)
	g1.GET("/treeData", "system:dept:view", DeptController.TreeData)
	g1.GET("/selectDeptTree", "system:dept:view", DeptController.SelectDeptTree)
	g1.GET("/roleDeptTreeData", "system:dept:view", DeptController.RoleDeptTreeData)
}
